package edu.sctu.zhengsenwen.month201506.day20150603;




import java.text.SimpleDateFormat;
import java.util.Calendar;



/**
* Created by user15 on 2015/6/6.
*/


public class TimeManagementSystem {



    /**
     *
     * @param passenger
     */
    public  void timeDeath(Passenger passenger) {

        Calendar calendar = Calendar.getInstance();

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");     //设置时间的格式


        //把进站时间转换成指定时间类型
        String inTime = simpleDateFormat.format(calendar.getTime());

        System.out.println("进站时间：  " + inTime);



        //在进站时间的基础上加上乘车时间
        SubwayCard  subwayCard = new SubwayCard();



        int count = subwayCard.getCount(passenger.getStart(),passenger.getEnd());

        count = count * 2;

        calendar.roll(Calendar.SECOND, count);

        String outTime = simpleDateFormat.format(calendar.getTime());

        System.out.println("出战时间：  "+ outTime);

    }



}


